/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.garethc.chpt2.fuelconsumption.fuelconsumption.impl;

import za.ac.cput.garethc.chpt2.fuelconsumption.fuelconsumption.FuelConsumption;


/**
 *
 * @author Gareth
 */
public class FuelConsumptionImpl implements FuelConsumption
{

    @Override
    public double litresPer100km(double km, double litres) 
    {
        return (litres/km)*100;
    }

    @Override
    public double mpg(double miles, double gallons) 
    {
        return miles/gallons;
    }

    @Override
    public double convertToLitresPer100km(double mpg) 
    {
        return (100*3.785411784)/(1.609344*mpg);
    }

    @Override
    public double convertToMPG(double litresPer100km) 
    {
        return (100*3.785411784)/(1.609344*litresPer100km);
    }
    
}
